home *** CD-ROM | disk | FTP | other *** search
- global current,hoff,hpos,hcol,msprite, fsprite
- global hspace,datecast,spriteorder
- global keydates, lasthl, cdvar, bigskip
- global currentmin, currentmax
-
- on startmovie
- setupdatevars
- setupdummydates
- end startmovie
-
-
- on setupmenu
- set fsprite = 63
- set bigskip = 28
- set datecast = the number of member "datecast"
- set spriteorder =[0,1,2,3,4,5]
- set current = 1
- set currentmin = 1
- set currentmax = 2557
- repeat with j = 1 to 6
- puppetsprite (fsprite+j),1
- set the text of cast (datecast+(j-1)) = finddate (mygetat(keydates,current+(j-3)))
- set the forecolor of member (datecast+(j-1)) = 0
- end repeat
- set lasthl = datecast+2
- set the forecolor of member lasthl = 5
- set hoff = 0
- set hspace = 128
- updatestage
- end setupmenu
-
-
- on redisplaydates
- if cdvar then
- repeat with j = 1 to 6
- set the text of cast (datecast+getat(spriteorder,j)) =¨
- finddate (mygetat(keydates,current+(bigskip*(cdvar*(j-3)))))
- end repeat
- else
- repeat with j = 1 to 6
- set the text of cast (datecast+getat(spriteorder,j)) =¨
- finddate (mygetat(keydates,current+(j-3)))
- end repeat
- end if
- updatestage
- end redisplaydates
-
-
-
- ON scrolldates
- if lasthl<>0 then
- set the forecolor of member lasthl = 0
- set lasthl = 0
- end if
- SET STEP = 20
- SET RANGE = 100
- SET baseH = THE MOUSEH
- REPEAT WHILE THE stilldown
- SET TMPH = THE MOUSEH
- -- set the loch of sprite cursprite = tmph
- -- set the locv of sprite cursprite = tmpv
- set tmph = tmph-baseh
- IF TMPH <>0 THEN
- SET X = -TMPH/5
- if x>48 then
- set x = 48
- else if x<-48 then
- set x = -48
- end if
- END IF
- if moveposs (x) then
- displaydates x
- end if
- END REPEAT
- updatestage
- END scrolldates
-
- on mywait val
- global lasttime
- repeat while the ticks < lasttime+val
- end repeat
- set lasttime = the ticks
- end mywait
-
- on findclosest
- set sofar = 1000
- repeat with j = 1 to 6
- set dist = abs(320-(the loch of sprite (10+(j-1))+64))
- if dist<=sofar then
- set sofar = dist
- set cnum = j-1
- end if
- end repeat
- return (cnum)
- end findclosest
-
-
- on lockondates
- set closest = findclosest()
- set p1 = the loch of sprite (10+closest)+64
- if p1>320 then
- set tdist = p1-320
- set tmpdist = tdist
- repeat while tmpdist<>0
- set scrollval = tmpdist/5
- if scrollval<1 then
- set scrollval =1
- end if
- displaydates -scrollval
- set tmpdist = tmpdist-scrollval
- end repeat
- else if p1<320 then
- set tdist = 320-p1
- set tmpdist = tdist
- repeat while tmpdist<>0
- set scrollval = tmpdist/5
- if scrollval<1 then
- set scrollval =1
- end if
- displaydates scrollval
- set tmpdist = tmpdist-scrollval
- end repeat
- else
- autoclick
- end if
- set closest = findclosest()
- set lasthl = datecast+closest
- set the forecolor of member lasthl = 5
- updatestage
- end lockondates
-
- on autoclick
- set tclickpt = the clickloc
- set tclick = getat(tclickpt,1)
- if tclick>512 then
- set scdir = -2
- else if tclick>384 then
- set scdir = -1
- else if tclick<128 then
- set scdir = 2
- else if tclick<256 then
- set scdir = 1
- end if
- if movepossauto(scdir) then
- set tdist = 128
- set tmpdist = tdist
- repeat while tmpdist<>0
- set scrollval = tmpdist/5
- if scrollval<1 then
- set scrollval =1
- end if
- displaydates scrollval*scdir
- set tmpdist = tmpdist-scrollval
- end repeat
- set closest = findclosest()
- set lasthl = datecast+closest
- set the forecolor of member lasthl = 5
- updatestage
- end if
- end autoclick
-
- on movepossauto dir
- if cdvar then
- if dir>0 then
- if (current-bigskip)-((dir-1)*bigskip)>=currentmin then
- return (1)
- else
- return (0)
- end if
- else if dir<0 then
- if ((current+bigskip)+((abs(dir)-1)*bigskip))<=currentmax then
- return (1)
- else
- return (0)
- end if
- end if
- else
- if (current-(dir-1)>currentmin and dir>0) or¨
- (current+(abs(dir)-1)<currentmax and dir<0) then
- return (1)
- else
- return (0)
- end if
- end if
- end movepossauto
-
- on moveposs dir
- if cdvar then
- if dir>0 then
- if current-bigskip>currentmin then
- return (1)
- else
- return (0)
- end if
- else if dir<0 then
- if current+bigskip<currentmax then
- return (1)
- else
- return (0)
- end if
- end if
- else
- if (current>currentmin and dir>0) or (current<currentmax and dir<0) then
- return (1)
- else
- return (0)
- end if
- end if
- end moveposs
-
-
- on displaydates factor
- if factor <0 then
- if the loch of sprite (fsprite+1+getat(spriteorder,1))<=-126 then
- set the loch of sprite (fsprite+1+getat(spriteorder,1)) = ¨
- the loch of sprite (fsprite+1+getat(spriteorder,1))+640+128
- switchorder 1
- end if
- else if factor >0 then
- if the loch of sprite (fsprite+1+getat(spriteorder,6))>=640 then
- set the loch of sprite (fsprite+1+getat(spriteorder,6)) = ¨
- the loch of sprite (fsprite+1+getat(spriteorder,6))-640-128
- switchorder 0
- end if
- end if
- repeat with j = 1 to 6
- set spriteloch = the loch of sprite (fsprite+1+getat(spriteorder,j))
- set spriteloch = spriteloch+factor
- set the loch of sprite (fsprite+1+getat(spriteorder,j)) = spriteloch
- end repeat
- mywait 1
- updatestage
- end displaydates
-
- on switchorder right
- if right then
- set tmp = getat (spriteorder,1)
- repeat with j = 1 to 5
- setat spriteorder,j,getat(spriteorder,j+1)
- end repeat
- setat spriteorder,6,tmp
- if cdvar then
- set current = current+bigskip
- set the text of cast (datecast+getat(spriteorder,6)) = ¨
- finddate(mygetat(keydates,current+(3*bigskip)))
- else
- set current = current+1
- set the text of cast (datecast+getat(spriteorder,6)) = ¨
- finddate(mygetat(keydates,current+3))
- end if
- else
- set tmp = getat (spriteorder,6)
- repeat with j = 6 down to 2
- setat spriteorder,j,getat(spriteorder,j-1)
- end repeat
- setat spriteorder,1,tmp
- if cdvar then
- set current = current-bigskip
- set the text of cast (datecast+getat(spriteorder,1)) = ¨
- finddate(mygetat(keydates,current-(2*bigskip)))
- else
- set current = current-1
- set the text of cast (datecast+getat(spriteorder,1)) = ¨
- finddate(mygetat(keydates,current-2))
- end if
- end if
- end switchorder
-
- on mygetat var,pos
- if pos<currentmin or pos>currentmax then
- return (0)
- else
- return (getat(var,pos))
- end if
- end mygetat
-